package com.hxci.zhangcong.controller;

import com.hxci.zhangcong.servcie.UserServcie;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.net.http.HttpRequest;

@Controller
@RequestMapping("user")
public class UserController {


    @RequestMapping("login")
    public String login(){
        return "zhangcong/login";
    }


    @Autowired
    private UserServcie userServcie;
    @ResponseBody
    @RequestMapping("tologin")
    public Integer tologin( @RequestParam("name") String name, @RequestParam("pass")String  pass){
        System.out.println( name);
        System.out.println( pass);
       Integer res = userServcie.logion(name,pass);
        return res;
    }

}
